<?php

namespace app\common\model;

class MachineMachine extends Base
{
    protected $deleteTime='delete_time';

    /**
     * @param array $machine_ids
     * @param string $field
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getMachineByMachineIDs(array $machine_ids = [], string $field = '*'): array
    {
        return $this->field($field)
            ->whereIn('machine_id',$machine_ids)
            ->select()
            ->toArray();
    }
    public function machineCate(){
        return $this->hasOne(MachineCate::class,'id','machine_cate');
    }
}